package com.cn.study.second.stage.code3.zuoye3;

public class CallPackage  extends Abstract implements CallInterface {
    private int message;

    Consumption code = new Consumption();
    /**
     *  expenses    资费
     *  quantity    赠送通话时间
     *  message     赠送短信
     */

    public CallPackage() {
    }

    public CallPackage(int expenses, int quantity, int message) {
        super(expenses, quantity);
        this.message = message;
    }

    public int getMessage() {
        return message;
    }

    public void setMessage(int message) {
        this.message = message;
    }

    //  通话类：打印套餐情况
    @Override
    public void show() {
        System.out.printf("通讯套餐：国内语音%d元/分钟，赠送%d分钟国内语音，赠送国内短彩信%d条，包含国内接听来电显示。",getExpenses(),getQuantity(),getMessage());
    }
    //  重写通话服务接口方法
    @Override
    public void callPackage(int callTime,PhoneCard PhoneCard) {
        if (getQuantity() == 0){
            setQuantity(1);
        }
        code.countCallTime(callTime,getQuantity(),PhoneCard);
    }
}
